﻿Imports Microsoft.Reporting.WebForms
Public Class ReporteDetalle
    Inherits System.Web.UI.Page

    Dim strIP As String

    Private Sub principal(ByVal strIP As String)
        Me.ReportViewer1.LocalReport.ReportPath = ("reportes\ReporteDetalleIP.rdlc")
        Me.ReportViewer1.LocalReport.DataSources.Clear()

        Dim adapter As New DataSetTableAdapters.USP_CONSULTA_X_IP_DETALLE_EQUIPOTableAdapter
        Dim table As New DataSet.USP_CONSULTA_X_IP_DETALLE_EQUIPODataTable

        'adapter.FillTb_Equipo(table, strIP, strMAC, strNombre)
        'adapter.FillTb_Equipo(table, strIP, strMAC)
        adapter.FillDetalle_Equipo(table, strIP)

        Me.ReportViewer1.LocalReport.DataSources.Add(New ReportDataSource("DataSet1", CType(table, DataTable)))
        Me.ReportViewer1.DataBind()

    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub btnConsultar_Click(sender As Object, e As EventArgs) Handles btnConsultar.Click
        If txtIP.Text.Length = 0 Then
            strIP = Nothing
        Else
            strIP = txtIP.Text
        End If
        principal(strIP)
    End Sub
End Class